module(
    name = "gazelle",
    version = "0.31.0",
    repo_name = "bazel_gazelle",
)

bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.39.1", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_proto", version = "4.0.0")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")

# Known to exist since it is instantiated by rules_go itself.
use_repo(
    go_sdk,
    go_sdk = "go_default_sdk",
)

non_module_deps = use_extension("//internal/bzlmod:non_module_deps.bzl", "non_module_deps")
use_repo(
    non_module_deps,
    "bazel_gazelle_go_repository_cache",
    "bazel_gazelle_go_repository_tools",
)

rules_go_non_module_deps = use_extension("@io_bazel_rules_go//go/private:extensions.bzl", "non_module_dependencies")
use_repo(
    rules_go_non_module_deps,
    "go_googleapis",
)

go_deps = use_extension("//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
    go_deps,
    "com_github_bazelbuild_buildtools",
    "com_github_bmatcuk_doublestar_v4",
    "com_github_fsnotify_fsnotify",
    "com_github_google_go_cmp",
    "com_github_pmezard_go_difflib",
    "org_golang_x_mod",
    "org_golang_x_sync",
    "org_golang_x_tools",
    # Read by go_repository rules.
    "bazel_gazelle_go_repository_config",
)

bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.5.1", dev_dependency = True, repo_name = "io_bazel_stardoc")
